/**
 * Created by zhangsong on 2019/9/22.
 */

// 默认分页参数
export const defaultPaginationParam = {
  page: 1,
  pageSize: 10,
};

// 表单布局
export const formItemLayout = {
  labelCol: {
    xs: { span: 24 },
    sm: { span: 8 },
  },
  wrapperCol: {
    xs: { span: 24 },
    sm: { span: 16 },
  },
};

export const gender = {
  0: 'male',
  1: 'female',
};

// 调用后端接口 API 时,对应的时间格式
export const datetimeFormat = {
  date: 'YYYY-MM-DD',
  time: 'YYYY-MM-DD HH:mm:ss',
  hours: 'HH:mm:ss',
};

export const WorkCardDefault = {
  greenCard: '建造業安全訓練證明書(綠卡)',
  blueCard: '船上貨物處理基礎安全訓練證明書(海上藍卡)',
  registerCard: '建造業工人註冊證',
};

export const Pagination = (params = {}) => {
  const {
    page = defaultPaginationParam.page,
    limit = defaultPaginationParam.pageSize,
    total = 0,
    ...other
  } = params;
  return Object.assign(
    {
      current: page,
      defaultCurrent: 1,
      defaultPageSize: defaultPaginationParam.pageSize,
      pageSize: limit,
      // pageSizeOptions: ['10', '20', '50', '100'],
      pageSizeOptions: ['10', '20', '30'],
      showQuickJumper: true,
      showSizeChanger: true,
      total,
    },
    other,
  );
};

export default {};
